package com.rrd.dw.mr.gzip.kafka;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ucredit.babel.common.model.BaseModel;
import com.ucredit.babel.common.model.RecordType;
import com.ucredit.babel.common.model.third.fayanyuan.FayanyuanData;
import com.ucredit.babel.common.model.third.fayanyuan.FayanyuanPersonRecord;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper.Context;

import java.io.IOException;

/**
 * 法研院-自然人数据
 *
 * @author renzhanzheng
 */

public class FaYanYuanCaseParse extends ParseBase {
    private Text val = new Text();
    private Text key = new Text();
    /**
     * 法研院-自然人数据
     *
     * @param model
     * @throws IOException
     * @throws InterruptedException
     */
    @Override
    public boolean parseJob(Context context, BaseModel<?> model, String successful) throws IOException, InterruptedException {
        FayanyuanPersonRecord obj = (FayanyuanPersonRecord)model;
        FayanyuanData data = obj.getData();
        String apiType = data.getApiType();
        if (!("." + apiType).equals(getSubType()) && !("." + apiType).equals(getApiType())) {
            return false;
        }
        JSONObject info = obj.getData() == null ? new JSONObject() : JSON.parseObject(data.getData());
        JSONObject result = info.getJSONObject("data") == null ? new JSONObject() : info.getJSONObject("data");
        JSONObject count = result.getJSONObject("count") == null ? new JSONObject() : result.getJSONObject("count");

        JSONObject civil = result.getJSONObject("civil") == null ? new JSONObject() : result.getJSONObject("civil");
        JSONObject civilCount = civil.getJSONObject("count") == null ? new JSONObject() : civil.getJSONObject("count");
        JSONObject criminal = result.getJSONObject("criminal") == null ? new JSONObject() : result.getJSONObject("criminal");
        JSONObject criminalCount = criminal.getJSONObject("count") == null ? new JSONObject() : criminal.getJSONObject("count");
        JSONObject administrative = result.getJSONObject("administrative") == null ? new JSONObject() : result.getJSONObject("administrative");
        JSONObject administrativeCount = administrative.getJSONObject("count") == null ? new JSONObject() : administrative.getJSONObject("count");
        JSONObject implement = result.getJSONObject("implement") == null ? new JSONObject() : result.getJSONObject("implement");
        JSONObject implementCount = implement.getJSONObject("count") == null ? new JSONObject() : implement.getJSONObject("count");
        JSONObject bankrupt = result.getJSONObject("bankrupt") == null ? new JSONObject() : result.getJSONObject("bankrupt");
        JSONObject bankruptCount = bankrupt.getJSONObject("count") == null ? new JSONObject() : bankrupt.getJSONObject("count");

        StringBuilder sb = getBaseInfo(obj, successful);

        //失信被执行人计数
        sb.append(info.getString("sxbzxr") == null ? "" : info.getString("sxbzxr")).append(CRT001);
        //案件总数(总计)
        sb.append(count.getString("count_total") == null ? "" : count.getString("count_total")).append(CRT001);
        //已结案总数(总计)
        sb.append(count.getString("count_jie_total") == null ? "" : count.getString("count_jie_total")).append(CRT001);
        //未结案总数(总计)
        sb.append(count.getString("count_wei_total") == null ? "" : count.getString("count_wei_total")).append(CRT001);
        //原告总数(总计)
        sb.append(count.getString("count_yuangao") == null ? "" : count.getString("count_yuangao")).append(CRT001);
        //原告已结案总数(总计)
        sb.append(count.getString("count_jie_yuangao") == null ? "" : count.getString("count_jie_yuangao")).append(CRT001);
        //原告未结案总数(总计)
        sb.append(count.getString("count_wei_yuangao") == null ? "" : count.getString("count_wei_yuangao")).append(CRT001);
        //被告总数(总计)
        sb.append(count.getString("count_beigao") == null ? "" : count.getString("count_beigao")).append(CRT001);
        //被告已结案总数(总计)
        sb.append(count.getString("count_jie_beigao") == null ? "" : count.getString("count_jie_beigao")).append(CRT001);
        //被告未结案总数(总计)
        sb.append(count.getString("count_wei_beigao") == null ? "" : count.getString("count_wei_beigao")).append(CRT001);
        //第三人总数(总计)
        sb.append(count.getString("count_other") == null ? "" : count.getString("count_other")).append(CRT001);
        //第三人已结案总数(总计)
        sb.append(count.getString("count_jie_other") == null ? "" : count.getString("count_jie_other")).append(CRT001);
        //第三人未结案总数(总计)
        sb.append(count.getString("count_wei_other") == null ? "" : count.getString("count_wei_other")).append(CRT001);
        //涉案总金额(总计)
        sb.append(count.getString("money_total") == null ? "" : count.getString("money_total")).append(CRT001);
        //已结案金额(总计)
        sb.append(count.getString("money_jie_total") == null ? "" : count.getString("money_jie_total")).append(CRT001);
        //未结案金额(总计)
        sb.append(count.getString("money_wei_total") == null ? "" : count.getString("money_wei_total")).append(CRT001);
        //未结案金额百分比(总计)
        sb.append(count.getString("money_wei_percent") == null ? "" : count.getString("money_wei_percent")).append(CRT001);
        //原告金额(总计)
        sb.append(count.getString("money_yuangao") == null ? "" : count.getString("money_yuangao")).append(CRT001);
        //原告已结金额(总计)
        sb.append(count.getString("money_jie_yuangao") == null ? "" : count.getString("money_jie_yuangao")).append(CRT001);
        //原告未结案金额(总计)
        sb.append(count.getString("money_wei_yuangao") == null ? "" : count.getString("money_wei_yuangao")).append(CRT001);
        //被告已结案金额(总计)
        sb.append(count.getString("money_jie_beigao") == null ? "" : count.getString("money_jie_beigao")).append(CRT001);
        //被告未结案金额(总计)
        sb.append(count.getString("money_wei_beigao") == null ? "" : count.getString("money_wei_beigao")).append(CRT001);
        //被告金额(总计)
        sb.append(count.getString("money_beigao") == null ? "" : count.getString("money_beigao")).append(CRT001);
        //第三人金额(总计)
        sb.append(count.getString("money_other") == null ? "" : count.getString("money_other")).append(CRT001);
        //第三人已结案金额(总计)
        sb.append(count.getString("money_jie_other") == null ? "" : count.getString("money_jie_other")).append(CRT001);
        //第三人未结案金额(总计)
        sb.append(count.getString("money_wei_other") == null ? "" : count.getString("money_wei_other")).append(CRT001);
        //涉案案由分布(总计)
        sb.append(count.getString("ay_stat") == null ? "" : count.getString("ay_stat")).append(CRT001);
        //涉案时间分布(总计)
        sb.append(count.getString("larq_stat") == null ? "" : count.getString("larq_stat")).append(CRT001);
        //涉案地点分布(总计)
        sb.append(count.getString("area_stat") == null ? "" : count.getString("area_stat")).append(CRT001);
        //结案方式分布(总计)
        sb.append(count.getString("jafs_stat") == null ? "" : count.getString("jafs_stat")).append(CRT001);
        //案件总数(行政案件)
        sb.append(administrativeCount.getString("count_total") == null ? "" : administrativeCount.getString("count_total")).append(CRT001);
        //已结案总数(行政案件)
        sb.append(administrativeCount.getString("count_jie_total") == null ? "" : administrativeCount.getString("count_jie_total")).append(CRT001);
        //未结案总数(行政案件)
        sb.append(administrativeCount.getString("count_wei_total") == null ? "" : administrativeCount.getString("count_wei_total")).append(CRT001);
        //原告总数(行政案件)
        sb.append(administrativeCount.getString("count_yuangao") == null ? "" : administrativeCount.getString("count_yuangao")).append(CRT001);
        //原告已结案总数(行政案件)
        sb.append(administrativeCount.getString("count_jie_yuangao") == null ? "" : administrativeCount.getString("count_jie_yuangao")).append(CRT001);
        //原告未结案总数(行政案件)
        sb.append(administrativeCount.getString("count_wei_yuangao") == null ? "" : administrativeCount.getString("count_wei_yuangao")).append(CRT001);
        //被告总数(行政案件)
        sb.append(administrativeCount.getString("count_beigao") == null ? "" : administrativeCount.getString("count_beigao")).append(CRT001);
        //被告已结案总数(行政案件)
        sb.append(administrativeCount.getString("count_jie_beigao") == null ? "" : administrativeCount.getString("count_jie_beigao")).append(CRT001);
        //被告未结案总数(行政案件)
        sb.append(administrativeCount.getString("count_wei_beigao") == null ? "" : administrativeCount.getString("count_wei_beigao")).append(CRT001);
        //第三人总数(行政案件)
        sb.append(administrativeCount.getString("count_other") == null ? "" : administrativeCount.getString("count_other")).append(CRT001);
        //第三人已结案总数(行政案件)
        sb.append(administrativeCount.getString("count_jie_other") == null ? "" : administrativeCount.getString("count_jie_other")).append(CRT001);
        //第三人未结案总数(行政案件)
        sb.append(administrativeCount.getString("count_wei_other") == null ? "" : administrativeCount.getString("count_wei_other")).append(CRT001);
        //涉案总金额(行政案件)
        sb.append(administrativeCount.getString("money_total") == null ? "" : administrativeCount.getString("money_total")).append(CRT001);
        //已结案金额(行政案件)
        sb.append(administrativeCount.getString("money_jie_total") == null ? "" : administrativeCount.getString("money_jie_total")).append(CRT001);
        //未结案金额(行政案件)
        sb.append(administrativeCount.getString("money_wei_total") == null ? "" : administrativeCount.getString("money_wei_total")).append(CRT001);
        //未结案金额百分比(行政案件)
        sb.append(administrativeCount.getString("money_wei_percent") == null ? "" : administrativeCount.getString("money_wei_percent")).append(CRT001);
        //原告金额(行政案件)
        sb.append(administrativeCount.getString("money_yuangao") == null ? "" : administrativeCount.getString("money_yuangao")).append(CRT001);
        //原告已结金额(行政案件)
        sb.append(administrativeCount.getString("money_jie_yuangao") == null ? "" : administrativeCount.getString("money_jie_yuangao")).append(CRT001);
        //原告未结案金额(行政案件)
        sb.append(administrativeCount.getString("money_wei_yuangao") == null ? "" : administrativeCount.getString("money_wei_yuangao")).append(CRT001);
        //被告已结案金额(行政案件)
        sb.append(administrativeCount.getString("money_jie_beigao") == null ? "" : administrativeCount.getString("money_jie_beigao")).append(CRT001);
        //被告未结案金额(行政案件)
        sb.append(administrativeCount.getString("money_wei_beigao") == null ? "" : administrativeCount.getString("money_wei_beigao")).append(CRT001);
        //被告金额(行政案件)
        sb.append(administrativeCount.getString("money_beigao") == null ? "" : administrativeCount.getString("money_beigao")).append(CRT001);
        //第三人金额(行政案件)
        sb.append(administrativeCount.getString("money_other") == null ? "" : administrativeCount.getString("money_other")).append(CRT001);
        //第三人已结案金额(行政案件)
        sb.append(administrativeCount.getString("money_jie_other") == null ? "" : administrativeCount.getString("money_jie_other")).append(CRT001);
        //第三人未结案金额(行政案件)
        sb.append(administrativeCount.getString("money_wei_other") == null ? "" : administrativeCount.getString("money_wei_other")).append(CRT001);
        //涉案案由分布(行政案件)
        sb.append(administrativeCount.getString("ay_stat") == null ? "" : administrativeCount.getString("ay_stat")).append(CRT001);
        //涉案时间分布(行政案件)
        sb.append(administrativeCount.getString("larq_stat") == null ? "" : administrativeCount.getString("larq_stat")).append(CRT001);
        //涉案地点分布(行政案件)
        sb.append(administrativeCount.getString("area_stat") == null ? "" : administrativeCount.getString("area_stat")).append(CRT001);
        //结案方式分布(行政案件)
        sb.append(administrativeCount.getString("jafs_stat") == null ? "" : administrativeCount.getString("jafs_stat")).append(CRT001);
        //案件总数(民事案件)
        sb.append(civilCount.getString("count_total") == null ? "" : civilCount.getString("count_total")).append(CRT001);
        //已结案总数(民事案件)
        sb.append(civilCount.getString("count_jie_total") == null ? "" : civilCount.getString("count_jie_total")).append(CRT001);
        //未结案总数(民事案件)
        sb.append(civilCount.getString("count_wei_total") == null ? "" : civilCount.getString("count_wei_total")).append(CRT001);
        //原告总数(民事案件)
        sb.append(civilCount.getString("count_yuangao") == null ? "" : civilCount.getString("count_yuangao")).append(CRT001);
        //原告已结案总数(民事案件)
        sb.append(civilCount.getString("count_jie_yuangao") == null ? "" : civilCount.getString("count_jie_yuangao")).append(CRT001);
        //原告未结案总数(民事案件)
        sb.append(civilCount.getString("count_wei_yuangao") == null ? "" : civilCount.getString("count_wei_yuangao")).append(CRT001);
        //被告总数(民事案件)
        sb.append(civilCount.getString("count_beigao") == null ? "" : civilCount.getString("count_beigao")).append(CRT001);
        //被告已结案总数(民事案件)
        sb.append(civilCount.getString("count_jie_beigao") == null ? "" : civilCount.getString("count_jie_beigao")).append(CRT001);
        //被告未结案总数(民事案件)
        sb.append(civilCount.getString("count_wei_beigao") == null ? "" : civilCount.getString("count_wei_beigao")).append(CRT001);
        //第三人总数(民事案件)
        sb.append(civilCount.getString("count_other") == null ? "" : civilCount.getString("count_other")).append(CRT001);
        //第三人已结案总数(民事案件)
        sb.append(civilCount.getString("count_jie_other") == null ? "" : civilCount.getString("count_jie_other")).append(CRT001);
        //第三人未结案总数(民事案件)
        sb.append(civilCount.getString("count_wei_other") == null ? "" : civilCount.getString("count_wei_other")).append(CRT001);
        //涉案总金额(民事案件)
        sb.append(civilCount.getString("money_total") == null ? "" : civilCount.getString("money_total")).append(CRT001);
        //已结案金额(民事案件)
        sb.append(civilCount.getString("money_jie_total") == null ? "" : civilCount.getString("money_jie_total")).append(CRT001);
        //未结案金额(民事案件)
        sb.append(civilCount.getString("money_wei_total") == null ? "" : civilCount.getString("money_wei_total")).append(CRT001);
        //未结案金额百分比(民事案件)
        sb.append(civilCount.getString("money_wei_percent") == null ? "" : civilCount.getString("money_wei_percent")).append(CRT001);
        //原告金额(民事案件)
        sb.append(civilCount.getString("money_yuangao") == null ? "" : civilCount.getString("money_yuangao")).append(CRT001);
        //原告已结金额(民事案件)
        sb.append(civilCount.getString("money_jie_yuangao") == null ? "" : civilCount.getString("money_jie_yuangao")).append(CRT001);
        //原告未结案金额(民事案件)
        sb.append(civilCount.getString("money_wei_yuangao") == null ? "" : civilCount.getString("money_wei_yuangao")).append(CRT001);
        //被告已结案金额(民事案件)
        sb.append(civilCount.getString("money_jie_beigao") == null ? "" : civilCount.getString("money_jie_beigao")).append(CRT001);
        //被告未结案金额(民事案件)
        sb.append(civilCount.getString("money_wei_beigao") == null ? "" : civilCount.getString("money_wei_beigao")).append(CRT001);
        //被告金额(民事案件)
        sb.append(civilCount.getString("money_beigao") == null ? "" : civilCount.getString("money_beigao")).append(CRT001);
        //第三人金额(民事案件)
        sb.append(civilCount.getString("money_other") == null ? "" : civilCount.getString("money_other")).append(CRT001);
        //第三人已结案金额(民事案件)
        sb.append(civilCount.getString("money_jie_other") == null ? "" : civilCount.getString("money_jie_other")).append(CRT001);
        //第三人未结案金额(民事案件)
        sb.append(civilCount.getString("money_wei_other") == null ? "" : civilCount.getString("money_wei_other")).append(CRT001);
        //涉案案由分布(民事案件)
        sb.append(civilCount.getString("ay_stat") == null ? "" : civilCount.getString("ay_stat")).append(CRT001);
        //涉案时间分布(民事案件)
        sb.append(civilCount.getString("larq_stat") == null ? "" : civilCount.getString("larq_stat")).append(CRT001);
        //涉案地点分布(民事案件)
        sb.append(civilCount.getString("area_stat") == null ? "" : civilCount.getString("area_stat")).append(CRT001);
        //结案方式分布(民事案件)
        sb.append(civilCount.getString("jafs_stat") == null ? "" : civilCount.getString("jafs_stat")).append(CRT001);
        //案件总数(执行案件)
        sb.append(implementCount.getString("count_total") == null ? "" : implementCount.getString("count_total")).append(CRT001);
        //已结案总数(执行案件)
        sb.append(implementCount.getString("count_jie_total") == null ? "" : implementCount.getString("count_jie_total")).append(CRT001);
        //未结案总数(执行案件)
        sb.append(implementCount.getString("count_wei_total") == null ? "" : implementCount.getString("count_wei_total")).append(CRT001);
        //原告总数(执行案件)
        sb.append(implementCount.getString("count_yuangao") == null ? "" : implementCount.getString("count_yuangao")).append(CRT001);
        //原告已结案总数(执行案件)
        sb.append(implementCount.getString("count_jie_yuangao") == null ? "" : implementCount.getString("count_jie_yuangao")).append(CRT001);
        //原告未结案总数(执行案件)
        sb.append(implementCount.getString("count_wei_yuangao") == null ? "" : implementCount.getString("count_wei_yuangao")).append(CRT001);
        //被告总数(执行案件)
        sb.append(implementCount.getString("count_beigao") == null ? "" : implementCount.getString("count_beigao")).append(CRT001);
        //被告已结案总数(执行案件)
        sb.append(implementCount.getString("count_jie_beigao") == null ? "" : implementCount.getString("count_jie_beigao")).append(CRT001);
        //被告未结案总数(执行案件)
        sb.append(implementCount.getString("count_wei_beigao") == null ? "" : implementCount.getString("count_wei_beigao")).append(CRT001);
        //第三人总数(执行案件)
        sb.append(implementCount.getString("count_other") == null ? "" : implementCount.getString("count_other")).append(CRT001);
        //第三人已结案总数(执行案件)
        sb.append(implementCount.getString("count_jie_other") == null ? "" : implementCount.getString("count_jie_other")).append(CRT001);
        //第三人未结案总数(执行案件)
        sb.append(implementCount.getString("count_wei_other") == null ? "" : implementCount.getString("count_wei_other")).append(CRT001);
        //涉案总金额(执行案件)
        sb.append(implementCount.getString("money_total") == null ? "" : implementCount.getString("money_total")).append(CRT001);
        //已结案金额(执行案件)
        sb.append(implementCount.getString("money_jie_total") == null ? "" : implementCount.getString("money_jie_total")).append(CRT001);
        //未结案金额(执行案件)
        sb.append(implementCount.getString("money_wei_total") == null ? "" : implementCount.getString("money_wei_total")).append(CRT001);
        //未结案金额百分比(执行案件)
        sb.append(implementCount.getString("money_wei_percent") == null ? "" : implementCount.getString("money_wei_percent")).append(CRT001);
        //原告金额(执行案件)
        sb.append(implementCount.getString("money_yuangao") == null ? "" : implementCount.getString("money_yuangao")).append(CRT001);
        //原告已结金额(执行案件)
        sb.append(implementCount.getString("money_jie_yuangao") == null ? "" : implementCount.getString("money_jie_yuangao")).append(CRT001);
        //原告未结案金额(执行案件)
        sb.append(implementCount.getString("money_wei_yuangao") == null ? "" : implementCount.getString("money_wei_yuangao")).append(CRT001);
        //被告已结案金额(执行案件)
        sb.append(implementCount.getString("money_jie_beigao") == null ? "" : implementCount.getString("money_jie_beigao")).append(CRT001);
        //被告未结案金额(执行案件)
        sb.append(implementCount.getString("money_wei_beigao") == null ? "" : implementCount.getString("money_wei_beigao")).append(CRT001);
        //被告金额(执行案件)
        sb.append(implementCount.getString("money_beigao") == null ? "" : implementCount.getString("money_beigao")).append(CRT001);
        //第三人金额(执行案件)
        sb.append(implementCount.getString("money_other") == null ? "" : implementCount.getString("money_other")).append(CRT001);
        //第三人已结案金额(执行案件)
        sb.append(implementCount.getString("money_jie_other") == null ? "" : implementCount.getString("money_jie_other")).append(CRT001);
        //第三人未结案金额(执行案件)
        sb.append(implementCount.getString("money_wei_other") == null ? "" : implementCount.getString("money_wei_other")).append(CRT001);
        //涉案案由分布(执行案件)
        sb.append(implementCount.getString("ay_stat") == null ? "" : implementCount.getString("ay_stat")).append(CRT001);
        //涉案时间分布(执行案件)
        sb.append(implementCount.getString("larq_stat") == null ? "" : implementCount.getString("larq_stat")).append(CRT001);
        //涉案地点分布(执行案件)
        sb.append(implementCount.getString("area_stat") == null ? "" : implementCount.getString("area_stat")).append(CRT001);
        //结案方式分布(执行案件)
        sb.append(implementCount.getString("jafs_stat") == null ? "" : implementCount.getString("jafs_stat")).append(CRT001);
        //案件总数(刑事案件)
        sb.append(criminalCount.getString("count_total") == null ? "" : criminalCount.getString("count_total")).append(CRT001);
        //已结案总数(刑事案件)
        sb.append(criminalCount.getString("count_jie_total") == null ? "" : criminalCount.getString("count_jie_total")).append(CRT001);
        //未结案总数(刑事案件)
        sb.append(criminalCount.getString("count_wei_total") == null ? "" : criminalCount.getString("count_wei_total")).append(CRT001);
        //原告总数(刑事案件)
        sb.append(criminalCount.getString("count_yuangao") == null ? "" : criminalCount.getString("count_yuangao")).append(CRT001);
        //原告已结案总数(刑事案件)
        sb.append(criminalCount.getString("count_jie_yuangao") == null ? "" : criminalCount.getString("count_jie_yuangao")).append(CRT001);
        //原告未结案总数(刑事案件)
        sb.append(criminalCount.getString("count_wei_yuangao") == null ? "" : criminalCount.getString("count_wei_yuangao")).append(CRT001);
        //被告总数(刑事案件)
        sb.append(criminalCount.getString("count_beigao") == null ? "" : criminalCount.getString("count_beigao")).append(CRT001);
        //被告已结案总数(刑事案件)
        sb.append(criminalCount.getString("count_jie_beigao") == null ? "" : criminalCount.getString("count_jie_beigao")).append(CRT001);
        //被告未结案总数(刑事案件)
        sb.append(criminalCount.getString("count_wei_beigao") == null ? "" : criminalCount.getString("count_wei_beigao")).append(CRT001);
        //第三人总数(刑事案件)
        sb.append(criminalCount.getString("count_other") == null ? "" : criminalCount.getString("count_other")).append(CRT001);
        //第三人已结案总数(刑事案件)
        sb.append(criminalCount.getString("count_jie_other") == null ? "" : criminalCount.getString("count_jie_other")).append(CRT001);
        //第三人未结案总数(刑事案件)
        sb.append(criminalCount.getString("count_wei_other") == null ? "" : criminalCount.getString("count_wei_other")).append(CRT001);
        //涉案总金额(刑事案件)
        sb.append(criminalCount.getString("money_total") == null ? "" : criminalCount.getString("money_total")).append(CRT001);
        //已结案金额(刑事案件)
        sb.append(criminalCount.getString("money_jie_total") == null ? "" : criminalCount.getString("money_jie_total")).append(CRT001);
        //未结案金额(刑事案件)
        sb.append(criminalCount.getString("money_wei_total") == null ? "" : criminalCount.getString("money_wei_total")).append(CRT001);
        //未结案金额百分比(刑事案件)
        sb.append(criminalCount.getString("money_wei_percent") == null ? "" : criminalCount.getString("money_wei_percent")).append(CRT001);
        //原告金额(刑事案件)
        sb.append(criminalCount.getString("money_yuangao") == null ? "" : criminalCount.getString("money_yuangao")).append(CRT001);
        //原告已结金额(刑事案件)
        sb.append(criminalCount.getString("money_jie_yuangao") == null ? "" : criminalCount.getString("money_jie_yuangao")).append(CRT001);
        //原告未结案金额(刑事案件)
        sb.append(criminalCount.getString("money_wei_yuangao") == null ? "" : criminalCount.getString("money_wei_yuangao")).append(CRT001);
        //被告已结案金额(刑事案件)
        sb.append(criminalCount.getString("money_jie_beigao") == null ? "" : criminalCount.getString("money_jie_beigao")).append(CRT001);
        //被告未结案金额(刑事案件)
        sb.append(criminalCount.getString("money_wei_beigao") == null ? "" : criminalCount.getString("money_wei_beigao")).append(CRT001);
        //被告金额(刑事案件)
        sb.append(criminalCount.getString("money_beigao") == null ? "" : criminalCount.getString("money_beigao")).append(CRT001);
        //第三人金额(刑事案件)
        sb.append(criminalCount.getString("money_other") == null ? "" : criminalCount.getString("money_other")).append(CRT001);
        //第三人已结案金额(刑事案件)
        sb.append(criminalCount.getString("money_jie_other") == null ? "" : criminalCount.getString("money_jie_other")).append(CRT001);
        //第三人未结案金额(刑事案件)
        sb.append(criminalCount.getString("money_wei_other") == null ? "" : criminalCount.getString("money_wei_other")).append(CRT001);
        //涉案案由分布(刑事案件)
        sb.append(criminalCount.getString("ay_stat") == null ? "" : criminalCount.getString("ay_stat")).append(CRT001);
        //涉案时间分布(刑事案件)
        sb.append(criminalCount.getString("larq_stat") == null ? "" : criminalCount.getString("larq_stat")).append(CRT001);
        //涉案地点分布(刑事案件)
        sb.append(criminalCount.getString("area_stat") == null ? "" : criminalCount.getString("area_stat")).append(CRT001);
        //结案方式分布(刑事案件)
        sb.append(criminalCount.getString("jafs_stat") == null ? "" : criminalCount.getString("jafs_stat")).append(CRT001);
        //案件总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_total") == null ? "" : bankruptCount.getString("count_total")).append(CRT001);
        //已结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_jie_total") == null ? "" : bankruptCount.getString("count_jie_total")).append(CRT001);
        //未结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_wei_total") == null ? "" : bankruptCount.getString("count_wei_total")).append(CRT001);
        //原告总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_yuangao") == null ? "" : bankruptCount.getString("count_yuangao")).append(CRT001);
        //原告已结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_jie_yuangao") == null ? "" : bankruptCount.getString("count_jie_yuangao")).append(CRT001);
        //原告未结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_wei_yuangao") == null ? "" : bankruptCount.getString("count_wei_yuangao")).append(CRT001);
        //被告总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_beigao") == null ? "" : bankruptCount.getString("count_beigao")).append(CRT001);
        //被告已结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_jie_beigao") == null ? "" : bankruptCount.getString("count_jie_beigao")).append(CRT001);
        //被告未结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_wei_beigao") == null ? "" : bankruptCount.getString("count_wei_beigao")).append(CRT001);
        //第三人总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_other") == null ? "" : bankruptCount.getString("count_other")).append(CRT001);
        //第三人已结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_jie_other") == null ? "" : bankruptCount.getString("count_jie_other")).append(CRT001);
        //第三人未结案总数(强制清算与破产案件)
        sb.append(bankruptCount.getString("count_wei_other") == null ? "" : bankruptCount.getString("count_wei_other")).append(CRT001);
        //涉案案由分布(强制清算与破产案件)
        sb.append(bankruptCount.getString("ay_stat") == null ? "" : bankruptCount.getString("ay_stat")).append(CRT001);
        //涉案时间分布(强制清算与破产案件)
        sb.append(bankruptCount.getString("larq_stat") == null ? "" : bankruptCount.getString("larq_stat")).append(CRT001);
        //涉案地点分布(强制清算与破产案件)
        sb.append(bankruptCount.getString("area_stat") == null ? "" : bankruptCount.getString("area_stat")).append(CRT001);
        //结案方式分布(强制清算与破产案件)
        sb.append(bankruptCount.getString("jafs_stat") == null ? "" : bankruptCount.getString("jafs_stat")).append(CRT001);
        StringBuilder txSb = getBaseInfo(obj);
        key.set(getKey());
        val.set((sb.toString() + txSb.toString()).replace("\n", " ").replace("\r", " "));
        context.write(key, val);
        return true;
    }

    @Override
    public String getSubType() {
        return ".queryPerson";
    }

    public String getApiType(){
        return ".queryPersonV1";
    }

    @Override
    public String getTableName() {
        return "kafka_babel_fayanyuan_case_inc";
    }

    @Override
    public String getType() {
        return RecordType.FAYANYUAN_PERSON_RECORD.toString();
    }

    @Override
    public String getComment() {
        return "法研院-自然人数据";
    }
}
